package com.sky.mapper;

import com.sky.dto.dish.DishDTO;
import com.sky.entity.Category;
import com.sky.entity.SetMeal;
import com.sky.entity.User;
import com.sky.vo.UserDishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @Author 褚金龙
 * @Date 2024/9/17 12:25
 */
@Mapper
public interface UserMapper {
    User getByOpenid(String openid);

    void insert(User user);



    List<Category> categoryList(Integer type);

     //根据分类查询菜品/
    @Select("select *from dish where category_id=#{categoryId} and status=1")
   List<UserDishVO> dishList(Integer categoryId);


    @Select("select *from setmeal where category_id=#{categoryId} and status=1" )
    List<SetMeal> setMaelList(Integer categoryId);

    @Select("select *from user where id=#{userId}")
    User getById(Long userId);





    /**
     * 统计用户数据
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
